package com.thrd.taiexhibition;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.thrd.taiexhibition.bean.BaseActivity;

import org.jetbrains.annotations.Nullable;

/**
 * @author: ${唐杰}
 * @date: 2021/3/26
 */
@Route(path = "/app/text",group = "app")
public class TextActivity extends BaseActivity  {




    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text);
        TextView mTextView=findViewById(R.id.tv_text);
        mTextView.setText( getPhoneInfo());
        ShellCmd.getInstance(this).skateboardHangUp();

        mTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(TextActivity.this,"点击了屏幕",0).show();
            }
        });

    }

    @SuppressLint("MissingPermission")
    public String getPhoneInfo() {

        StringBuilder sb = new StringBuilder();
        DisplayMetrics metric = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metric);
      //  intwidth =metric.widthPixels;  //宽度（PX）
        sb.append("宽").append(metric.widthPixels);
      //  intheight =metric.heightPixels;  //高度（PX）
        sb.append("高").append(metric.heightPixels);
     //   floatdensity =metric.density;  //密度（0.75 / 1.0 / 1.5）
        sb.append("密度").append(metric.density);
       // intdensityDpi =metric.densityDpi;  //密度DPI（120 / 160 / 240）
        sb.append("dpi").append(metric.densityDpi);
        return sb.toString();
    }


//    private Handler handler=new Handler(Looper.getMainLooper());






}
